package com.example.group4.controller;

import com.example.group4.pojo.Student;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
public class StudentController {
    @GetMapping("/student")

    public Map<String,Object> getInfo(){
        Map<String,Object> map=new HashMap<>();
        Student student=new Student(3,"张三",26,"14359776","上海");
        map.put("Student",student);
        return map;
    }

    @GetMapping("/students")
    public Map<String,Object> getInfos(){
        Map<String,Object> map0=new HashMap<>();
        Student student1=new Student(3,"张三",26,"14359776","上海");
        Student student2=new Student(7,"李四",33,"33333333","北京");
        Student student3=new Student(2,"王五",19,"77742324","成都");
        map0.put("student1",student1);
        map0.put("student2",student2);
        map0.put("student3",student3);
        return map0;
    }
}
